Socket
Socket
Sign inDemoInstall

unicode-match-property-value

Package Overview
Dependencies
1
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    unicode-match-property-value

Match a Unicode property or property alias to its canonical property name without loose matching.


Version published
Weekly downloads
13
decreased by-7.14%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

unicode-match-property-value Build status

unicode-match-property-value matches a given Unicode property value or property value alias to its canonical property value without applying loose matching. Consider it a strict alternative to loose matching.

Installation

To use unicode-match-property-value programmatically, install it as a dependency via npm:

$ npm install unicode-match-property-value

Then, require it:

const matchPropertyValue = require('unicode-match-property-value');

API

This module exports a single function named matchPropertyValue.

matchPropertyValue(property, value)

This function takes a string property that is a canonical/unaliased Unicode property name, and a string value. It attemps to match value to a canonical Unicode property value for the given property. If there’s a match, it returns the canonical property value. Otherwise, it throws an exception.

// Find the canonical property value:
matchPropertyValue('Block', 'Alphabetic_PF')
// → 'Alphabetic_Presentation_Forms'

matchPropertyValue('Block', 'Alphabetic_Presentation_Forms')
// → 'Alphabetic_Presentation_Forms'

matchPropertyValue('block', 'Alphabetic_PF') // Note: incorrect casing.
// → throws

matchPropertyValue('Block', 'alphabetic_pf') // Note: incorrect casing.
// → throws

Author

twitter/mathias
Mathias Bynens

License

unicode-match-property-value is available under the MIT license.

Keywords

FAQs

Last updated on 19 Aug 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc